from rest_framework import serializers
from . import models


# 轮播图的序列器
class BannerModelSerializer(serializers.ModelSerializer):

    class Meta:
        model = models.Banner
        fields = ['id', 'link', 'image_url']


# 顶部导航栏的序列化器
class NavModelSerializer(serializers.ModelSerializer):

    class Meta:
        model = models.Nav
        fields = ['id', 'title', 'link', 'is_site']
